import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LoginView from '@/views/LoginView.vue'
import ProductView from '@/components/ProductView.vue'
import RoleAdminView from '@/components/RoleAdminView.vue'
import UserAdminView from '@/components/UserAdminView.vue'
import RoleEditView from '@/components/RoleEditView.vue'
import UserEditView from '@/components/UserEditView.vue'
import ProductEditView from '@/components/ProductEditView.vue'
import MonitoringView from '@/components/MonitoringView.vue'
import MonitoringAssetInofView from '@/components/MonitoringAssetInofView.vue'
import OrganizationAdminView from '@/components/OrganizationAdminView.vue'
import OrganizationEditView from '@/components/OrganizationEditView.vue'
import MonitoringAddView from '@/components/MonitoringAddView.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    children:[
      {
        path: '/product',
        name: 'product',
        component: ProductView
      },
      {
        path: '/role',
        name: 'roleAdmin',
        component: RoleAdminView
      },
      {
        path: '/user',
        name: 'userAdmin',
        component: UserAdminView
      },
      {
        path: '/roleEdit',
        name: 'roleEdit',
        component: RoleEditView
      },
      {
        path: '/userEdit',
        name: 'userEdit',
        component: UserEditView
      },
      {
        path: '/productEdit',
        name: 'ProductEdit',
        component: ProductEditView
      },
      {
        path: '/monitoring',
        name: 'Monitoring',
        component: MonitoringView
      },
      {
        path: '/organization',
        name: 'OrganizationAdmin',
        component: OrganizationAdminView
      },
      {
        path: '/organizationEdit',
        name: 'OrganizationEdit',
        component: OrganizationEditView
      },
      {
        path: '/monitoringAdd',
        name: 'MonitoringAddView',
        component: MonitoringAddView
      },
    
    ]
  },
   {
    path: '/login',
    name: 'login',
    component: LoginView
  },
  {
    path: '/monitoringAssetIno',
    name: 'MonitoringAssetIno',
    component: MonitoringAssetInofView
  },
      
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
